package com.liuqi.iot.domain.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.liuqi.common.base.domain.entity.BaseEntity;
import com.liuqi.iot.bean.DeviceSimulationField;
import lombok.Data;

import java.util.List;

/**
 * 模拟设备
 *
 * @author  LiuQi 2025/3/23-17:35
 * @version V1.0
 **/
@Data
@TableName(value = "t_device_simulation", autoResultMap = true)
public class DeviceSimulationEntity extends BaseEntity {
    /**
     * 设备编号
     */
    private String deviceCode;

    /**
     * 设备名称
     */
    private String deviceName;

    /**
     * 网关编号
     */
    private String gatewayCode;

    /**
     * 上数间隔，单位为S
     */
    @TableField("`interval`")
    private Integer interval;

    /**
     * 状态，0：未启动，1：已启动
     */
    private Integer status;

    /**
     * 设备模拟属性
     */
    @TableField(typeHandler = FastjsonTypeHandler.class)
    private List<DeviceSimulationField> fields;
}
